/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ar.com.wholeconsulting.pacc.gui.fluidos;

/**
 *
 * @author Duco Pablo
 */
public enum FluidoColum {
    NOMBRE(0,"Nombre"),
    M(1,"CalorLatenteDeVaporizacion"),
    SGG(2,"Sgg"),
    Z(3,"CoeficienteIncompresibilidad"),
    K(4,"K"),
    PUNTO_DE_INFLAMACION(5,"PuntoDeInflamacion"),
    PUNTO_DE_EBULLICION(6,"PuntoDeEbullicion"),
    DENSIDAD(7,"Densidad"),
    SGL(8,"Sgl"),
    CALOR_LATENTE_VAPORIZACION(9,"CalorLatenteDeVaporizacion");
    private int index;
    private String methodName;
            
    private FluidoColum(int i,String methodName) {
        index=i;
        this.methodName = methodName;
    }
    
    public int getIndex(){
        return this.index;
    }
    
    public String setterMethodName(){
        return "set"+methodName;
    }
    
    public String getterMethodName(){
        return "get"+methodName;
    }
    
    
    public static FluidoColum fromString(String fluido){
        fluido = fluido.toUpperCase().replaceAll(" ", "_");
        return FluidoColum.valueOf(fluido);
    }
   
    public static FluidoColum fromIndex(int index){
        for (FluidoColum fluid : FluidoColum.values()){
            if (fluid.index == index) {
                return fluid;
            }
        }
        throw new IllegalArgumentException();
    }
    
}
